﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Acn.Rdm.Packets.Product
{
    /// <summary>
    /// This parameter is used to get a descriptive ASCII text label for the Boot Version of the software
    /// for Devices that support this functionality. The descriptive text returned by this parameter is
    /// intended for display to the user. The label may be up to 32 characters.
    /// </summary>
    public class BootSoftwareVersionLabel
    {
        public class Get : RdmRequestPacket
        {
            public Get()
                : base(RdmCommands.Get, RdmParameters.BootSoftwareVersionLabel)
            {
            }

            #region Read and Write

            protected override void ReadData(RdmBinaryReader data)
            {
            }

            protected override void WriteData(RdmBinaryWriter data)
            {
            }

            #endregion
        }

        public class GetReply : RdmResponsePacket
        {
            public GetReply()
                : base(RdmCommands.GetResponse, RdmParameters.BootSoftwareVersionLabel)
            {
            }

            public string VersionLabel { get; set; }

            #region Read and Write

            protected override void ReadData(RdmBinaryReader data)
            {
                VersionLabel = data.ReadNetworkString(Header.ParameterDataLength);
            }

            protected override void WriteData(RdmBinaryWriter data)
            {
                data.WriteNetwork(VersionLabel);
            }

            #endregion
        }
    }
}
